import { request } from 'umi';

export async function fakeSubmitForm(params: any) {
  return request('/api/cmsArticle/save', {
    method: 'POST',
    data: params,
  });
}

export async function queryDetail(params: any) {
  return request('/api/hospitalNotice/' + params.id, {
    method: 'get',
    data: params,
  });
}

export async function queryProvince(params: any) {
  return request('/api/bsArea/tree', {
    method: 'POST',
    data: params,
  });
}

export async function list(params: any) {
  return request('/api/hospitalNotice/page', {
    method: 'POST',
    data: params,
  });
}

export async function update(params: any) {
  return request('/api/hospitalNotice/updateById', {
    method: 'PUT',
    data: params,
  });
}

export async function del(data: { key: number[] }, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/hospitalNotice/' + data.key, {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}

export async function fakeSubmit(params: any) {
  return request('/api/cmsArticle/save', {
    method: 'POST',
    data: params,
  });
}

export async function updateArticleDeptIds(params: any) {
  return request('/api/hospitalNotice/updateById', {
    method: 'PUT',
    data: params,
  });
}


export async function queryDeptList(params: any) {
  return request('/api/hospitalDept/listByEntity', {
    method: 'get',
    params,
  });
}

export async function queryArticleDepts(params: any) {
  return request('/api/hospitalNotice/deptList/' + params.id, {
    method: 'get',
  });
}

export async function fakeSubmitNotice(params: any) {
  return request('/api/hospitalNotice/save', {
    method: 'POST',
    data: params,
  });
}

export async function queryArticleDetail(params: any) {
  return request('/api/cmsArticle/' + params.id, {
    method: 'get',
    data: params,
  });
}

export async function updateArticle(params: any) {
  return request('/api/cmsArticle/edit', {
    method: 'PUT',
    data: params,
  });
}
